<%-- 
    Document   : CreateMerchantAccountStatus
    Created on : Sep 27, 2011, 9:42:23 AM
    Author     : Belinda
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList, BusinessLogic.Constants"%>
<!DOCTYPE html>
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <title>FoodSage - Create Merchant Account</title>

        <script language="javascript" type="text/javascript" src="../TransactWeb/js/jquery-1.6.4.min.js"></script>
        <script language="javascript" type="text/javascript" src="../TransactWeb/js/jquery.form.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/fieldsetCollapse.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/tcubmenu.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/accordion.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/scroller.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/Utilities.js"></script>

        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/gridsys.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/reset1.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/tcube.css" />
        <link href="../TransactWeb/css/gridsys.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/tcubaccd.css" />
        <script type="text/javascript">
            // Check Session to show relevant menus
            // Be sure to import Utilities.js in the script file	and declare partnerMenu as a servelet element
            window.onload = showPage('tcubeMenu', 'leftnav');

            // If not logged in, use : 
            //window.onload = showPage('topMenutcube', 'topmenu');
            //IF logged in use : 
            window.onload = showPage('topMenulogouttcube', 'topmenu');

            //welcome msg
            window.onload = showPage('welcomeMenutcube','welcome');

            //footer
            window.onload = showPage('tcubeFooter','footer');
        </script>

    </head>

    <body>
        <div class="container_12">
            <!-- Header Nav -->
            <div class="grid_3"><img src="../TransactWeb/img/reservation/foodsglogo.png" width="146" height="178" /></div>
            <div class="grid_9 nav">
                <div id="topmenu"></div>
            </div>

            <div class="grid_12">
                <hr size="3" color="#CC6600" />
            </div>

            <!-- Welcome Message -->
            <div class="grid_12 welcome">
                <div id="welcome"></div>
            </div>
            <!-- End Welcome Message-->

            <!-- End of Header Nav -->
            <!-- Menu / Planner -->
            <div class="grid_4">
                <div id="leftnav"></div>
            </div>

            <!--End Menu/ Planner -->
            <!-- Content -->
            <div class="grid_8 content">
                <!-- Content Header -->

                <table width="600" border="0">
                    <tr>
                        <td class="content_title">Merchant Account Management</td>
                    </tr>
                    <tr>
                        <td class="content_purpose">Merchant Account Status</td>
                    </tr>
                </table>
                <!-- End Content Header-->

                <!-- Form -->
                <table width="636" border="0" class="form">
                    <tr>
                        <td>
                            <%
                                ArrayList data = (ArrayList) request.getAttribute("data");
                                int result = ((Integer) data.get(0)).intValue();
                                if (result == Constants.STATUS_SUCCESSFUL) {
                            %>

                            You have successfully created an account for the Merchant.<br/>
                            If you're not redirected to Homepage in 10s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.

                            <script type="text/javascript">
                                $(document).ready(function() {
                                    setTimeout(window.location.replace("http://localhost:8080/portal/internal/TCubeHome"), 4000);
                                });
                            </script>

                            <%} else if (result == Constants.STATUS_NOT_UNIQUE) {
                            %>

                            A Manager with this IC number, Username or email has already registered with us.<br/>
                            Please check the information you typed again.<br/>
                            If you're not redirected to Create Merchant Account page in 6s, please click <a href="javascript: history.back()">here</a>.

                            <script type="text/javascript">
                                $(document).ready(function() {
                                    setTimeout(history.back(), 6000);
                                });
                            </script>

                            <%        } else if (result == Constants.STATUS_SESSION_EXPIRED) {
                            %>

                            Your session has expired. Please login again!<br/>
                            If you're not redirected to TCube Homepage in 4s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.

                            <script type="text/javascript">
                                $(document).ready(function() {
                                    setTimeout(window.location.replace("http://localhost:8080/portal/internal/TCubeHome"), 100000);
                                });
                            </script>

                            <%        } else if (result == Constants.STATUS_NOT_ALLOWED) {
                            %>

                            You're allowed to make such action!<br/>
                            We have logged your attempt for further investigation.<br/>
                            If you're not redirected to TCube Homepage in 4s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.

                            <script type="text/javascript">
                                $(document).ready(function() {
                                    setTimeout(window.location.replace("http://localhost:8080/portal/internal/TCubeHome"), 4000);
                                });
                            </script>

                            <%        } else if (result == Constants.STATUS_INVALID_INPUT) {
                            %>
                            Please ensure you have entered the correct information.<br/>
                            <%         } else {
                            %>
                            Sorry, unexpected errors occur.
                            <%         }
                            %>
                        </td>
                    </tr>
                </table>
                2 <%= request.getParameter("chosenUsername")%><br/>
                3 <%= request.getParameter("password1")%>   <br/>           
                4 <%= request.getParameter("level")%><br/>
                5 <%= request.getParameter("firstName")%><br/>
                6 <%= request.getParameter("lastName")%><br/>
                7 <%= request.getParameter("NRIC")%><br/>
                8 <%= request.getParameter("sex")%><br/>
                9 <%= request.getParameter("country")%><br/>
                10 <%= request.getParameter("phone")%><br/>
                11 <%= request.getParameter("email1")%><br/>
                12 <%= request.getParameter("country")%><br/>
                13 <%= request.getParameter("province")%><br/>
                14 <%= request.getParameter("city")%><br/>


                <!-- Partner -->  
                15 <%= request.getParameter("partnerName")%><br/>
                16 <%= request.getParameter("partnerBizAddress1")%><br/>
                17 <%= request.getParameter("partnerBizAddress2")%><br/>
                18 <%= request.getParameter("partnerBizPostalCode")%><br/>
                19 <%= request.getParameter("partnerCountryCode")%><br/>
                20 <%= request.getParameter("partnerPhone")%><br/>
                21 <%= request.getParameter("partnerCountry")%><br/>
                22 <%= request.getParameter("partnerProvince")%><br/>
                23 <%= request.getParameter("partnerCity")%><br/>
                24 <%= request.getParameter("partnerBizEmail")%><br/>
                25 <%= request.getParameter("partnerSector")%><br/>
                26 <%= request.getParameter("partnerBillingAddress1")%><br/>
                27 <%= request.getParameter("partnerBillingAddress2")%><br/>
                28 <%= request.getParameter("partnerBillingPostalCode")%><br/>
                <!-- End Form -->
            </div>
            <!-- End Content -->
            <!-- Footer -->
            <div class="grid_12 footer">
                <div id="footer"></div>
            </div>
            <!-- End Footer-->
        </div>
    </body>
</html>
